Skip to content

fix(interpreter): block internal variable namespace injection#445

Merged
chaliy merged 1 commit intomainfrom
claude/fix-407-Y2nIj
Mar 1, 2026
Merged

fix(interpreter): block internal variable namespace injection#445
chaliy merged 1 commit intomainfrom
claude/fix-407-Y2nIj

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 1, 2026

Summary

  • Add is_internal_variable() helper to identify NAMEREF, READONLY, UPPER, LOWER prefixes
  • Block user assignment to internal marker variables in set_variable()
  • Filter internal markers from ${!prefix*} expansion output

Test plan

  • 4 new tests: prefix exposure, readonly exposure, assignment block, readonly injection block
  • All 1435 existing tests pass
  • clippy clean

Closes #407

@chaliy chaliy force-pushed the claude/fix-407-Y2nIj branch from 24fbc1a to ee0b605 Compare March 1, 2026 07:30
THREAT[TM-INJ-009]: User scripts could assign to internal marker
prefixes (_NAMEREF_, _READONLY_, _UPPER_, _LOWER_) to manipulate
interpreter behavior. Block user assignment in set_variable() and
filter internal markers from ${!prefix*} expansion.

Closes #407

https://claude.ai/code/session_01WZjYqxm5xMPAEe7FSHJkDy
@chaliy chaliy force-pushed the claude/fix-407-Y2nIj branch from ee0b605 to 209e630 Compare March 1, 2026 07:41
@chaliy chaliy merged commit 48fde7a into main Mar 1, 2026
17 checks passed
@chaliy chaliy deleted the claude/fix-407-Y2nIj branch March 12, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[H-1] Internal variable namespace injection (_NAMEREF_, _READONLY_, etc.)

2 participants